package com.freshman.order.api;


import com.freshman.dto.OrderDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
public class OrderController {
    private static final Logger LOGGER = LoggerFactory.getLogger(OrderController.class);
    @Value("${server.port}")
    private int port;

    @RequestMapping(value = "query",method = RequestMethod.POST)
    public Map<String,Object> queryOrder(@RequestBody OrderDTO orderDTO,@RequestParam("phone") String phone){
        Map<String, Object> result = new HashMap<>();
        result.put("orderNo",orderDTO.getOrderNo()+phone+port);
        return result;
    }

}
